\(\int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\) [153]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 29 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {\tan (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )^2} \]

[Out]

tan(d*x+c)/d/(a^2+I*a^2*tan(d*x+c))^2

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 34} \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {\tan (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )^2} \]

[In]

Int[Sec[c + d*x]^4/(a + I*a*Tan[c + d*x])^4,x]

[Out]

Tan[c + d*x]/(d*(a^2 + I*a^2*Tan[c + d*x])^2)

Rule 34

Int[((a_) + (b_.)*(x_))^(m_.)*((c_) + (d_.)*(x_)), x_Symbol] :> Simp[d*x*((a + b*x)^(m + 1)/(b*(m + 2))), x] /
; FreeQ[{a, b, c, d, m}, x] && EqQ[a*d - b*c*(m + 2), 0]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \text {Subst}\left (\int \frac {a-x}{(a+x)^3} \, dx,x,i a \tan (c+d x)\right )}{a^3 d} \\ & = \frac {\tan (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.24 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {i (i+\tan (c+d x))^2}{4 a^4 d (-i+\tan (c+d x))^2} \]

[In]

Integrate[Sec[c + d*x]^4/(a + I*a*Tan[c + d*x])^4,x]

[Out]

((I/4)*(I + Tan[c + d*x])^2)/(a^4*d*(-I + Tan[c + d*x])^2)

Maple [A] (verified)

Time = 0.45 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.66

method result size
risch \(\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{4 a^{4} d}\) \(19\)
derivativedivides \(\frac {-\frac {i}{\left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{\tan \left (d x +c \right )-i}}{a^{4} d}\) \(36\)
default \(\frac {-\frac {i}{\left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{\tan \left (d x +c \right )-i}}{a^{4} d}\) \(36\)

[In]

int(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/4*I/a^4/d*exp(-4*I*(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.59 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {i \, e^{\left (-4 i \, d x - 4 i \, c\right )}}{4 \, a^{4} d} \]

[In]

integrate(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/4*I*e^(-4*I*d*x - 4*I*c)/(a^4*d)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (24) = 48\).

Time = 1.17 (sec) , antiderivative size = 95, normalized size of antiderivative = 3.28 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\begin {cases} \frac {i \sec ^{4}{\left (c + d x \right )}}{4 a^{4} d \tan ^{4}{\left (c + d x \right )} - 16 i a^{4} d \tan ^{3}{\left (c + d x \right )} - 24 a^{4} d \tan ^{2}{\left (c + d x \right )} + 16 i a^{4} d \tan {\left (c + d x \right )} + 4 a^{4} d} & \text {for}\: d \neq 0 \\\frac {x \sec ^{4}{\left (c \right )}}{\left (i a \tan {\left (c \right )} + a\right )^{4}} & \text {otherwise} \end {cases} \]

[In]

integrate(sec(d*x+c)**4/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise((I*sec(c + d*x)**4/(4*a**4*d*tan(c + d*x)**4 - 16*I*a**4*d*tan(c + d*x)**3 - 24*a**4*d*tan(c + d*x)*
*2 + 16*I*a**4*d*tan(c + d*x) + 4*a**4*d), Ne(d, 0)), (x*sec(c)**4/(I*a*tan(c) + a)**4, True))

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (27) = 54\).

Time = 0.22 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.28 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {\tan \left (d x + c\right )^{2} - i \, \tan \left (d x + c\right )}{{\left (a^{4} \tan \left (d x + c\right )^{3} - 3 i \, a^{4} \tan \left (d x + c\right )^{2} - 3 \, a^{4} \tan \left (d x + c\right ) + i \, a^{4}\right )} d} \]

[In]

integrate(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

-(tan(d*x + c)^2 - I*tan(d*x + c))/((a^4*tan(d*x + c)^3 - 3*I*a^4*tan(d*x + c)^2 - 3*a^4*tan(d*x + c) + I*a^4)
*d)

Giac [A] (verification not implemented)

none

Time = 0.62 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.52 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {2 \, {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a^{4} d {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{4}} \]

[In]

integrate(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-2*(tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c))/(a^4*d*(tan(1/2*d*x + 1/2*c) - I)^4)

Mupad [B] (verification not implemented)

Time = 3.91 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.86 \[ \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {\mathrm {tan}\left (c+d\,x\right )}{a^4\,d\,{\left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}^2} \]

[In]

int(1/(cos(c + d*x)^4*(a + a*tan(c + d*x)*1i)^4),x)

[Out]

-tan(c + d*x)/(a^4*d*(tan(c + d*x) - 1i)^2)